<template>
	<view class="all">
		<view class="name">
			<view class="name_text">
				任务名称:
			</view>
			<view class="name_text2">
				{{title}}
			</view>
		</view>
		<view class="name">
			<view class="name_text">
				任务金额:
			</view>
			<view class="name_text2">
				￥{{price}}
			</view>
		</view>
		<view class="name">
			<view class="name_text">
				完成状态:
			</view>
			<view class="name_text2">
				{{text}}
			</view>
		</view>
		<view class="Photo" style="border: 1px solid #0081FF;" v-show="status=='0'?true:false">
			<u-upload  ref="uUpload" :action="action" :max-count="1" :width="650" :height="350"
				@on-success="success"></u-upload>
		</view>
		<u-button v-show="status=='0'?true:false" @click="submit" style="margin-top: 50rpx;background-color: #0081FF;color: #FFFFFF;">提交</u-button>
	</view>
</template>

<script>
	import {
		getFile
	} from '@/api/user.js';
	import {
		audit
	} from '@/api/user.js';
	import {
		baseURL
	} from '@/config/app';
	export default {
		data() {
			return {
				action: baseURL+ 'new_recharge/getFile',
				price: "",
				title: "",
				url:"",
				file_id:"",
				order_sn:"",
				status:"",// 订单状态
				text:""
			}
		},
		onLoad(e) {
			this.price = e.price
			this.title = e.title
			this.order_sn=e.order_sn
			this.status=e.status
			console.log(this.status)
		},
		onShow() {
			if(this.status==0){
				this.text="待提交"
				
			}
			if(this.status==1){
				this.text="审核中"
			}
			if(this.status==2){
				this.text="已完成"
			}
			if(this.status==4){
				this.text="审核不通过"
			}
		},
		methods: {
			success(data, index, lists, name){
				console.log(data)
				this.file_id=data.data.file_id
			},
			back(){
				uni.navigateBack({
				   delta: 1,
				})
			},
			submit() {
				let data={
					// file_id:this.file_id,
					 file_id:1,
					order_sn:this.order_sn
				}
				audit(data).then(res=>{
					uni.showToast({
						title:res.msg
					})
				},err=>{})
				
				setTimeout(this.back, 2000)
			}
		}
	}
</script>

<style lang="less">
	.all {
		padding: 0 40rpx;

		.name {
			margin-top: 20rpx;
			padding: 15rpx 0;
			border-bottom: 1px solid #CCCCCC;

			.name_text {
				font-size: 35rpx;
			}

			.name_text2 {
				margin-top: 15rpx;
				color: #999999;
			}
		}
	}
</style>
